using System;
using System.Collections.Generic;
using FreeSql.DataAnnotations;

namespace Colorful.Furniture.UserManagement
{
    /// <summary>
    /// 用户
    /// </summary>
    [Table(Name = "usr_user")]
    public class User
    {
        /// <summary>
        /// 编码
        /// </summary>
        [Column(Name = "id", IsPrimary = true)]
        public Guid Id { get; set; }

        /// <summary>
        ///  用户编码
        /// </summary>
        [Column(Name = "user_code", IsIdentity = true)]
        public int UserCode { get; set; }

        /// <summary>
        /// 添加时间
        /// </summary>
        [Column(Name = "add_time")]
        public DateTime? AddTime { get; set; }

        /// <summary>
        /// 收货地址（JSON存放）
        /// </summary>
        [Column(Name = "address", StringLength = 4000)]
        public string Address { get; set; }

        /// <summary>
        /// 账户金额（不可提现，可以抵扣订单金额）
        /// </summary>
        [Column(Name = "amount", Precision = 2)]
        public decimal? Amount { get; set; }

        /// <summary>
        /// 生日
        /// </summary>
        [Column(Name = "birthday")]
        public DateTime? Birthday { get; set; }

        /// <summary>
        /// 电话号码
        /// </summary>
        [Column(Name = "phone_number", StringLength = 50)]
        public string PhoneNumber { get; set; }

        /// <summary>
        /// 用户等级
        /// </summary>
        [Column(Name = "user_level_id")]
        public Guid? UserLevelId { get; set; }

        /// <summary>
        /// 用户姓名
        /// </summary>
        [Column(Name = "name", StringLength = 50)]
        public string Name { get; set; }

        /// <summary>
        ///  昵称
        /// </summary>
        [Column(Name = "nick_name", StringLength = 50)]
        public string NickName { get; set; }

        /// <summary>
        ///  省
        /// </summary>
        [Column(Name = "province", StringLength = 50)]
        public string Province { get; set; }

        /// <summary>
        ///  城市
        /// </summary>
        [Column(Name = "country", StringLength = 50)]
        public string City { get; set; }

        /// <summary>
        /// 积分
        /// </summary>
        [Column(Name = "point")]
        public int Point { get; set; }

        /// <summary>
        /// 性别，值为男，女，未知
        /// </summary>
        [Column(Name = "sex", StringLength = 10)]
        public string Sex { get; set; }

        /// <summary>
        ///  用户备注
        /// </summary>
        [Column(Name = "remark", StringLength = 200)]
        public string Remark { get; set; }

        /// <summary>
        /// 状态（0：待审核；1：已审核）
        /// </summary>
        [Column(Name = "status")]
        public int? Status { get; set; }

        /// <summary>
        ///  是否删除
        /// </summary>
        [Column(Name = "is_deleted")]
        public bool IsDeleted { get; set; }

        /// <summary>
        /// 用户标签（中文，以逗号隔开）
        /// </summary>
        [Column(Name = "label", StringLength = 500)]
        public string Label { get; set; }

        /// <summary>
        ///  头像
        /// </summary>
        [Column(Name = "avatar_url", StringLength = 500)]
        public string AvatarUrl { get; set; }

        #region 外键 => 导航属性，ManyToOne/OneToOne

        #endregion

        #region 外键 => 导航属性，OneToMany

        /// <summary>
        ///  用户授权集合
        /// </summary>
        public virtual List<UserIdentity> UserIdentities { get; set; }

        #endregion

        #region 外键 => 导航属性，ManyToMany

        #endregion
    }

}
